<template>
    <Child2 @add="handleAdd"></Child2>  
  <ul class="list">
    <li class="list-item" v-for="(item, index) in list" :key="index">
      {{ item }}</li>
  </ul>
</template>

<script setup>
import { ref } from 'vue';
import Child2 from './components/Child2-2.vue'
const list=ref(['html'])
const handleAdd=(val)=>{  //add事件出现，handleAdd触发
  list.value.push(val.toUpperCase())
}
</script>

<style lang="scss" scoped>
</style>